 <!--_meta 作为公共模版分离出去-->
<!DOCTYPE HTML>
<html>
<head>
<title>客户管理</title>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />

<link rel="Bookmark" href="/favicon.ico" >
<link rel="Shortcut Icon" href="/favicon.ico" />
<!--[if lt IE 9]>
<script type="text/javascript" src="__PUBLIC__/Admin/lib/html5.js"></script>
<script type="text/javascript" src="__PUBLIC__/Admin/lib/respond.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/Admin/lib/PIE_IE678.js"></script>
<![endif]-->
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Admin/lib/static/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Admin/lib/static/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Admin/lib/Hui-iconfont/1.0.7/iconfont.css" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Admin/css/sty.css">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/page.css">
<!--[if IE 6]>
<script type="text/javascript" src="http://lib.h-ui.net/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<!--/meta 作为公共模版分离出去-->

<style type="text/css">
	.f-w{font-weight: bold;}
    /*.input-text{border: none !important}*/
    textarea{width: 95% !important}
    .textarea{height: 50px !important}
    .page-container{margin-bottom: 25px}
    /*button{margin-left: 20px }*/
    .bg-c,.normalEvenTD{
    background: #f5fafe;
    }
    .normalOddTD{
    background: #FFFFFF;
    }
    .table th,.table td{line-height: 20px !important;padding:8px !important;font-size:14px !important;}
    .table-bordered th, .table-bordered td{border-left: 1px solid #a0a0a0}
    .table-border th, .table-border td{border-bottom: 1px solid #a0a0a0}
    .table-bordered{border: 1px solid #a0a0a0}
    .b-le1{border-left: none !important}
    .breadcrumb{font-size: 12px !important}
</style>
</head>


<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 客户管理 <span class="c-gray en">&gt;</span> 客户管理列表 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
        <form class="form form-horizontal" action="{:U('Client/index')}" method="post">
        <div class="text-c">
            <eq name="Think.session.USER_AUTH.oa_level" value="2"> <!-- 销售经理用户  -->
                <select name="search_type" class="input-text" style="width:80px;padding-top: 1px;">
                    <option value="all" <eq name="search_type" value="all">selected</eq> >全部</option>
                    <option value="my" <eq name="search_type" value="my">selected</eq> >我的</option>
                    <option value="xiashu" <eq name="search_type" value="xiashu">selected</eq> >下属</option>
                </select>
            </eq>
            <input type="text" onfocus="WdatePicker()" id="logmin" name="date_begin" value="{$date_begin}" class="input-text Wdate" style="width:120px;" placeholder="请选择日期">
            -
            <input type="text" onfocus="WdatePicker()" id="logmax" name="date_end" value="{$date_end}" class="input-text Wdate" style="width:120px;" placeholder="请选择日期">
            <button class="btn btn-success radius" type="submit"><i class="Hui-iconfont">&#xe665;</i>搜索</button>
        </div>
    </form>
        <div class="cl pd-5 bg-1 bk-gray mt-20">
            <neq name="Think.session.USER_AUTH.oa_level" value="3">
                <span class="l">
                    <a href="javascript:;" onclick="client_all_del()" class="btn btn-danger radius"><i class="Hui-iconfont">&#xe6e2;</i> 批量删除</a>
                    <a class="btn btn-primary radius"  style="text-decoration:none" class="ml-5"  onclick="client_html('添加客户','{:U("Client/add")}','10002')" href="javascript:;" title="添加客户"><i class="Hui-iconfont">&#xe600; </i>添加客户</a>
                </span>
            </neq>
            <span class="r ">共有数据：<strong>{$count}</strong> 条</span>
        </div>
    	<div class="mt-20">
            <div id="DataTables_Table_0_wrapper" class="dataTables_wrapper no-footer">

                <table class="list table table-border table-bordered table-bg table-hover table-sort dataTable no-footer">
                    <thead>
                        <tr class="text-c" role="row">
                            <th class="b-le1" width="25">
                                <input type="checkbox" name="" value="">
                            </th>
                            <th width="50">ID</th>
                            <th width="80">营销人</th>
                            <th width="80">经办人</th>
                            <th width="200">门店</th>
                            <th width="200">中介公司</th>
                            <th >门店地址</th>
                            <th width="80">添加时间</th>
                            <th width="120">操作</th>
                        </tr>
                    </thead>
                    <tbody>
                        <volist name="clientList" id="val" empty="$empty">
                            <tr class="text-c odd" role="row">
                                <td class="b-le1"><input type="checkbox" value="{$val.id}" class="check_box"></td>
                                <td>{$i+($p-1)*10}</td>
                                <td>{$val.uid|get_user_name}</td>
                                <td>{$val.agent_name}</td>
                                <td>{$val.shop_id|get_shop_name}</td>
                                <td>{$val.company_id|get_company_name}</td>
                                <td>{$val.shop_id|get_shop_location}</td>
                                <td>{$val.add_time|time_for_date="Y-m-d H:i"}</td>
                                <td class="f-14 td-manage">
                                    <a style="text-decoration:none" class="ml-5" onclick="client_html('客户详情','{:U("Client/detail",array("id"=>$val["id"]))}','10002')" href="javascript:;">详情</a>
                                    <if condition="$Think.session.USER_AUTH.oa_level eq 4">  <!-- 管理员身份 -->
                                        <a style="text-decoration:none" class="ml-5" onclick="client_del('{:U("Client/del",array("id"=>$val["id"],"p"=>$p))}')" href="javascript:;">删除</a>
                                        <a style="text-decoration:none" class="ml-5" onclick="client_html('修改总结','{:U("Client/edit",array("id"=>$val["id"]))}','10002')" href="javascript:;">修改</a>
                                    <else/>
                                        <eq name="Think.session.USER_AUTH.userid" value="$val.uid">
                                            <a style="text-decoration:none" class="ml-5" onclick="client_del('{:U("Client/del",array("id"=>$val["id"],"p"=>$p))}')" href="javascript:;">删除</a>
                                            <a style="text-decoration:none" class="ml-5" onclick="client_html('修改总结','{:U("Client/edit",array("id"=>$val["id"]))}','10002')" href="javascript:;">修改</a>
                                        </eq>
                                    </if>
                                </td>
                            </tr>
                        </volist>

                    </tbody>
                </table>
                <div class="manu">{$page}</div>
            </div>
        </div>
</div>


<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="__PUBLIC__/Admin/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/Admin/lib/layer/2.1/layer.js"></script>
<script type="text/javascript" src="__PUBLIC__/Admin/lib/static/h-ui/js/H-ui.js"></script>
<script type="text/javascript" src="__PUBLIC__/Admin/lib/static/h-ui.admin/js/H-ui.admin.js"></script>
<script type="text/javascript" src="__PUBLIC__/Admin/lib/My97DatePicker/WdatePicker.js"></script>
<!--/_footer /作为公共模版分离出去-->


<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript">

// 新增 修改 详情
// function client_html(title,url,id,w,h){
//     layer_show(title,url);
// }
// 详情
function client_html(title,url,id,w,h){
    var index = layer.open({
        type: 2,
        title: title,
        content: url
    });
    layer.full(index);
}

// 删除
function client_del(url){
    layer.confirm('确认要删除吗？', {icon: 3, title:'删除'}, function(index){
        //$(obj).parents("tr").remove();
        layer.msg('已删除!',{icon:1,time:1000});
        window.location.href = url;
    });
}

// 批量删除
function client_all_del(){
    layer.confirm('确认要删除吗？', {icon: 3, title:'批量删除'},function(index){
        var wid = '';
        for (var i = $('.check_box').length - 1; i >= 0; i--) {
            if($('.check_box').eq(i).is(':checked')){
                wid = wid.length==0 ? $('.check_box').eq(i).val() : wid+','+$('.check_box').eq(i).val();
            }
        }
        if(wid.length == 0){
            layer.msg('请选择要删除的客户!',{icon:2,time:1000});
        }else{
            layer.msg('已删除!',{icon:1,time:1000});
            var url = "{:U('Client/del',array('id'=>wid,'p'=>$p))}";
            url = url.replace('wid',wid);
            window.location.href = url;
        }
    });
}



</script>

</body>
</html>
